package com.heima.feigns.wemedia;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.heima.config.HeimaFeignAutoConfiguration;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojo.WmNews;
import com.heima.model.wemedia.pojo.WmUser;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author TheCai
 * @version 1.0
 * @date 2021/5/25 19:28
 */
@FeignClient(value = "leadnews-wemedia" , configuration = HeimaFeignAutoConfiguration.class)
public interface WemediaFeign {

    @PostMapping("/api/v1/user/save")
    WmUser save(@RequestBody WmUser wmUser);

    @GetMapping("/api/v1/user/findByName/{name}")
    WmUser findByName(@PathVariable("name") String name);

    @GetMapping("/api/v1/news/findOne/{id}")
    WmNews findByID(@PathVariable("id") Integer id);

    @PutMapping("/api/v1/news/update")
    ResponseResult updateWmNews(@RequestBody WmNews wmNews);

    @GetMapping("/api/v1/user/findOne/{id}")
    WmUser findWmUserById(@PathVariable("id") Integer id);

    @GetMapping("/api/v1/news/findRelease")
    List<Integer> findRelease();
}
